#include <Game/Include/CreateSceneGameEvent.h>

CreateSceneGameEvent::CreateSceneGameEvent(const float &min_x, const float &max_x, const float &min_y, const float &max_y)
    :GameEvent(GameEventType::CREATE_SCENE_EVENT)
{
    this->min_x = min_x;
    this->max_x = max_x;
    this->min_y = min_y;
    this->max_y = max_y;
}

CreateSceneGameEvent::CreateSceneGameEvent(std::istream &s)
    :GameEvent(s)
{
    ISerializable::read(s, this->min_x);
    ISerializable::read(s, this->max_x);
    ISerializable::read(s, this->min_y);
    ISerializable::read(s, this->max_y);
}

CreateSceneGameEvent::~CreateSceneGameEvent(void)
{
}

unsigned int CreateSceneGameEvent::serialize(std::ostream &s)
{
    unsigned int bytes_written = GameEvent::serialize(s);
    bytes_written += ISerializable::write(s, this->min_x);
    bytes_written += ISerializable::write(s, this->max_x);
    bytes_written += ISerializable::write(s, this->min_y);
    bytes_written += ISerializable::write(s, this->max_y);
    return bytes_written;
}

float CreateSceneGameEvent::getMinX() const
{
    return this->min_x;
}

float CreateSceneGameEvent::getMaxX() const
{
    return this->max_x;
}

float CreateSceneGameEvent::getMinY() const
{
    return this->min_y;
}

float CreateSceneGameEvent::getMaxY() const
{
    return this->max_y;
}
